package com.example.everying.mapper.content;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.everying.model.entity.content.ActivityComment;
import com.example.everying.model.vo.content.ActivityCommentVo;
import com.github.houbb.heaven.annotation.reflect.Param;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ActivityCommentMapper extends BaseMapper<ActivityComment> {
    // 查询文章下的所有评论ID（按时间倒序）
    List<String> selectCommentIdsByArticleId(@Param("articleId") String articleId);
    // 批量查询评论详情
    List<ActivityComment> selectCommentsByIds(@Param("ids") List<String> ids);
    // 评论数据
    List<ActivityCommentVo> commentList(@Param("articleId") String articleId);

    void deleteIds(List<String> id);
    ActivityComment getCommentById(String id);

    ActivityComment getLastCommentHaveParent(String userId);

    ActivityComment getLastCommentHaveArticle(String parentId);
}
